class Solution {
    public int strStr(String haystack, String needle) {
        int dry=-1;
        int len=haystack.length();
        int lens=needle.length();
        char []p=haystack.toCharArray();
        char []d=needle.toCharArray();
        for(int i=0;i<=len-lens;i++)
        {
            int a=i,b=0;
            while(b<lens&&p[a]==d[b])
            {
                a++;
                b++;
            }
            if(b==lens)
            return i;
        }
        return -1;

    }
}
